/**
 * The contents of this file are subject to the license and copyright detailed in the LICENSE and NOTICE files at the root of the source tree and available online at
 * http://www.askosi.org/license.html
 */
package be.destin.skos.search;

import be.destin.skos.core.SkosManager;

public class SearchResult {
	String about;
	String label;
	String synonym;
	String synonymLanguage;
	String note;
	float quality;
	
	public SearchResult(String aPref, String aName, String aLang, String scopeNote, String about, float qual) {
		this.about = about;
		this.label = aPref;
		this.synonym = aName;
		this.synonymLanguage = aLang;
		this.note = scopeNote;
		this.quality = qual;
	}

	public String toFullOption() {
		String aSyn = "";
		String lang = synonymLanguage;
		if (synonym != null && !synonym.isEmpty() && !synonym.equals(label)) {
			if ((lang != null) && (!lang.isEmpty())) lang = '('+lang+')';
			else lang = "";
			aSyn = SkosManager.synonymPrefix+lang+synonym;
		}
		String aNote = "";
		if (note != null && !note.isEmpty()) {
			aNote = ": "+note;
		}
		return label+aSyn+aNote;
	}

	public String toOption() {
		String aSyn = "";
		String lang = synonymLanguage;
		if (synonym != null && !synonym.isEmpty() && !synonym.equals(label)) {
			if ((lang != null) && (!lang.isEmpty())) lang = "("+lang+")";
			else lang = "";
			aSyn = SkosManager.synonymPrefix+lang+synonym;
		}
		return label+aSyn;
	}

	public String getAbout() {
		return about;
	}
	public void setAbout(String about) {
		this.about = about;
	}
	public String getLabel() {
		return label;
	}
	public void setLabel(String label) {
		this.label = label;
	}
	public String getSynonym() {
		return synonym;
	}
	public void setSynonym(String synonym) {
		this.synonym = synonym;
	}
	public String getSynonymLanguage() {
		return synonymLanguage;
	}
	public void setSynonymLanguage(String synonymLanguage) {
		this.synonymLanguage = synonymLanguage;
	}
	public String getNote() {
		return note;
	}
	public void setNote(String note) {
		this.note = note;
	}
	public float getQuality() {
		return quality;
	}
	public void setQuality(float quality) {
		this.quality = quality;
	}
}
